<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html>
	<head>
		<base href="<%=basePath %>">
		<meta charset="utf-8">
		<title>在线代码解释器</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<link rel="stylesheet" href=css/bootstrap.min.css>
	</head>
	<body >
		<%@include file="/header.jsp" %>
		<div class="container">
		<h1>查看代码</h1>
		<hr />
		<div class="row" style="margin-top:15px;">
				<div class="row">
				    <label for="inputEmail3" class="col-sm-2 control-label">编程语言：</label>
				    <div class="col-sm-10">${code.language.name }</div>
				  </div>
					<div class="row">
				    <label for="inputEmail3" class="col-sm-2 control-label">代码名称：</label>
				    <div class="col-sm-10">${code.name }</div>
				  </div>
				  <div class="row">
				    <label for="inputEmail3" class="col-sm-2 control-label">创建人：</label>
				    <div class="col-sm-10">${code.user.nickName }</div>
				  </div>
				  <div class="row">
				  	 <div class="col-sm-12">
				  	 <pre> ${code.code }</pre>
				  	 </div>
				  </div>
				<h2>代码修改记录</h2>
				<hr />
				<dl>
					<c:forEach items="${logs }" var="log">
						<dt>${log.user.nickName } 修改于 <fmt:formatDate value="${log.modifyDate }" pattern="yyyy-MM-dd HH:mm"/></dt>
						<dd>${log.remark }</dd>
					</c:forEach>
				</dl>
			</div>
		</div>
	</body>
</html>






